package com.keste.ojt1.model.task10.appmod;

import com.keste.ojt1.model.task10.appmod.common.AppModuleT10;

import com.keste.ojt1.model.task10.view.OrderVORowImpl;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

import oracle.jbo.Row;
import oracle.jbo.RowSetIterator;
import oracle.jbo.server.ApplicationModuleImpl;
import oracle.jbo.server.ViewObjectImpl;
// ---------------------------------------------------------------------
// ---    File generated by Oracle ADF Business Components Design Time.
// ---    Mon Jul 11 13:33:32 IST 2011
// ---    Custom code may be added to this class.
// ---    Warning: Do not modify method signatures of generated methods.
// ---------------------------------------------------------------------
public class AppModuleT10Impl extends ApplicationModuleImpl implements AppModuleT10 {
    /**
     * This is the default constructor (do not remove).
     */
    public AppModuleT10Impl() {
    }


  /**
   * Container's getter for OrderVO1.
   * @return OrderVO1
   */
  public ViewObjectImpl getOrderVO1() {
      return (ViewObjectImpl)findViewObject("OrderVO1");
  }
  
  public void setCSVDatatoVO(ArrayList list){
      Iterator it = list.iterator();
    ViewObjectImpl vo = getOrderVO1();
        int i=0;
      while(it.hasNext()){
        List innerList = (List)it.next();
          if(innerList.size()!=0){
            Row row = vo.createRow();
            row.setAttribute("OrderId", innerList.get(0)); 
            row.setAttribute("OrderDescription", innerList.get(1)); 
            row.setAttribute("ItemId", innerList.get(2)); 
            row.setAttribute("MfgDate", innerList.get(3)); 
            row.setAttribute("ExpDate", innerList.get(4)); 
            row.setAttribute("ActiveFlag", innerList.get(5));                                       
            if(i!=0){
            vo.insertRow(row);
          }
           i++; 
          }
    }
    
  /*  Row row = vo.createRow();
    vo.insertRow(row);
    while(list != null) {
    row.setAttribute("OrderId", list.get(7));
        System.out.println("djvhb");
    } */
  }
}
